import axios from 'axios';

interface StarUsers {
  id: number;
  login: string;
  name: string;
  avatar_url: string;
  url: string;
  html_url: string;
  remark: string;
  followers_url: string;
  following_url: string;
  gists_url: string;
  starred_url: string;
  subscriptions_url: string;
  organizations_url: string;
  repos_url: string;
  events_url: string;
  received_events_url: string;
  type: string;
  star_at: string;
}
export const starUserQuery = ref({
  page: 1,
  per_page: 20,
});
/* star 的用户 */
export const starUsers = ref<StarUsers[]>([]);

export const getStarUsers = async () => {
  const http = axios.create();
  const { data } = await http.get(`https://gitee.com/api/v5/repos/in-git/ax/stargazers`, {
    params: starUserQuery.value,
  });
  starUsers.value = data;
};
